-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
gh-117031: Add support for new member types for PyMemberDef.type #117032
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
gh-117031: Add support for new member types for PyMemberDef.type #117032
Conversation
Add support for standard C and Posix integer types like Py_T_UINT32, Py_T_PTRDIFF, Py_T_OFF and Py_T_PID. Add Py_T_SSIZE as alias of Py_T_PYSSIZET.
!buildbot bsd |
🤖 New build scheduled with the buildbot fleet by @serhiy-storchaka for commit cf4ce29 🤖 The command will test the builders whose names match following regular expression: The builders matched are:
|
!buildbot s390 |
🤖 New build scheduled with the buildbot fleet by @serhiy-storchaka for commit cf4ce29 🤖 The command will test the builders whose names match following regular expression: The builders matched are:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -3272,6 +3272,15 @@ PyInit__testcapi(void) | |||
PyModule_AddObject(m, "SIZEOF_WCHAR_T", PyLong_FromSsize_t(sizeof(wchar_t))); | |||
PyModule_AddObject(m, "SIZEOF_VOID_P", PyLong_FromSsize_t(sizeof(void*))); | |||
PyModule_AddObject(m, "SIZEOF_TIME_T", PyLong_FromSsize_t(sizeof(time_t))); | |||
PyModule_AddObject(m, "SIZEOF_INTMAX_T", PyLong_FromSsize_t(sizeof(intmax_t))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's no longer used.
I prefer the #132550 approach -- solving this for all int types (not just C & POSIXy ones). |
@@ -115,6 +120,48 @@ PyMember_GetOne(const char *obj_addr, PyMemberDef *l) | |||
// doesn't require free-threading code path | |||
v = Py_NewRef(Py_None); | |||
break; | |||
case Py_T_INT8: | |||
case Py_T_INT8|Py_T_UINT8: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this type? I don't understand the usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It accepts full range of Py_T_UINT8 plus negative values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's weird. Which existing code needs such type?
Add support for standard C and Posix integer types like Py_T_UINT32, Py_T_PTRDIFF, Py_T_OFF and Py_T_PID.
Add Py_T_SSIZE as alias of Py_T_PYSSIZET.
📚 Documentation preview 📚: https://cpython-previews--117032.org.readthedocs.build/